package com.localjoycommunity.cpdj.project.system.service.impl;

import com.localjoycommunity.cpdj.project.system.domain.SysPaperQuestion;
import com.localjoycommunity.cpdj.project.system.domain.vo.QuestionPaperVo;
import com.localjoycommunity.cpdj.project.system.mapper.SysPaperQuestionMapper;
import com.localjoycommunity.cpdj.project.system.service.ISysPaperQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 试卷试题中间Service业务层处理
 *
 * @author leepandar
 * @date 2020-11-01
 */
@Service
public class SysPaperQuestionServiceImpl implements ISysPaperQuestionService {
    @Autowired
    private SysPaperQuestionMapper sysPaperQuestionMapper;

    /**
     * 查询试卷试题中间
     *
     * @param paperId 试卷试题中间ID
     * @return 试卷试题中间
     */
    @Override
    public SysPaperQuestion selectSysPaperQuestionById(Long paperId) {
        return sysPaperQuestionMapper.selectSysPaperQuestionById(paperId);
    }

    /**
     * 查询试卷试题中间列表
     *
     * @return 试卷试题中间
     */
    @Override
    public List<QuestionPaperVo> selectSysPaperQuestionList(Long paperId) {
        return sysPaperQuestionMapper.selectSysPaperQuestionList(paperId);
    }

    /**
     * 新增试卷试题中间
     *
     * @param sysPaperQuestion 试卷试题中间
     * @return 结果
     */
    @Override
    public int insertSysPaperQuestion(SysPaperQuestion sysPaperQuestion) {
        return sysPaperQuestionMapper.insertSysPaperQuestion(sysPaperQuestion);
    }

    /**
     * 修改试卷试题中间
     *
     * @param sysPaperQuestion 试卷试题中间
     * @return 结果
     */
    @Override
    public int updateSysPaperQuestion(SysPaperQuestion sysPaperQuestion) {
        return sysPaperQuestionMapper.updateSysPaperQuestion(sysPaperQuestion);
    }

    /**
     * 批量删除试卷试题中间
     *
     * @param paperIds 需要删除的试卷试题中间ID
     * @return 结果
     */
    @Override
    public int deleteSysPaperQuestionByIds(Long[] paperIds) {
        return sysPaperQuestionMapper.deleteSysPaperQuestionByIds(paperIds);
    }

    /**
     * 删除试卷试题中间信息
     *
     * @param paperId 试卷试题中间ID
     * @return 结果
     */
    @Override
    public int deleteSysPaperQuestionById(Long paperId) {
        return sysPaperQuestionMapper.deleteSysPaperQuestionById(paperId);
    }
}
